package uvt.map.graph.element;

import java.awt.Color;

import org.openstreetmap.gui.jmapviewer.Coordinate;

import uvt.map.graph.Node;

public class Vehicle {
	
	private String name;
	private String type;
	private Color color;
	private String route;
	private double speed;
	private Coordinate coord;
	private Node nextStation;
	
	public Vehicle() {
	}
	
	public Vehicle(String name,String type,Color color) {
		this.name = name;
		this.type = type;
		this.color = color;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getType() {
		return type;
	}
	
	public void setType(String type) {
		this.type = type;
		setColor(VehicleColor.getColorForVehicle(type));
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public String getRoute() {
		return route;
	}

	public void setRoute(String route) {
		this.route = route;
	}

	public double getSpeed() {
		if(type.equals("Tram"))
			speed = 25.0;
		else if(type.equals("Bus"))
			speed = 40.0;
		else if(type.equals("Trolleybus"))
			speed = 35.0;
		return speed;
	}

	public void setSpeed(double speed) {
		this.speed = speed;
	}

	public Coordinate getCoord() {
		return coord;
	}

	public void setCoord(Coordinate coord) {
		this.coord = coord;
	}

	public Node getNextStation() {
		return nextStation;
	}

	public void setNextStation(Node nextStation) {
		this.nextStation = nextStation;
	}

}